<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAccessTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('listen_access', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('url');
            $table->string('full_uri');
            $table->string('request_scheme');
            $table->string('http_host');
            $table->string('path_info');
            $table->text('query_string')->nullabel()->default(null);
            $table->string('request_method', 16);
            $table->boolean('is_ajax');
            $table->string('request_format', 16);
            $table->string('client_ip');
            $table->text('user_agent')->nullable()->default(null);
            $table->timestamp('request_time');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('listen_access');
    }
}
